package com.superatom.concurrent.basic.daemon;

import java.util.concurrent.ThreadFactory;

/**
 * 编写定制的ThreadFactorykey定制由Exector创建的线程的（后台、优先级、名称）
 */
public class DaemonThreadFactory implements ThreadFactory{
    public Thread newThread(Runnable r) {
        Thread t = new Thread(r);
        t.setDaemon(true);
        return t;
    }
}
